package models

import "gorm.io/gorm"

// WorkPlan 工作进度计划
type WorkPlan struct {
	gorm.Model
	ModelName string `json:"modelName" gorm:"type:varchar(100)"`
	WorkOrder string `json:"workOrder" gorm:"type:varchar(50)"`
	Quantity  int    `json:"quantity"`
	Date      string `json:"date" gorm:"type:varchar(20)"`
	Status    string `json:"status" gorm:"type:varchar(20)"`
	Notes     string `json:"notes" gorm:"type:text"`
}

// Material 物料外发清单
type Material struct {
	gorm.Model
	Serial   int    `json:"serial"`
	Model    string `json:"model" gorm:"type:varchar(100)"`
	Name     string `json:"name" gorm:"type:varchar(100)"`
	Quantity int    `json:"quantity"`
	Location string `json:"location" gorm:"type:varchar(100)"`
	Notes    string `json:"notes" gorm:"type:text"`
}

// WorkOrderData 数据查询
type WorkOrderData struct {
	gorm.Model
	WorkOrder         string `json:"workOrder" gorm:"type:varchar(50)"`
	WorkOrderType     string `json:"workOrderType" gorm:"type:varchar(50)"`
	PartNumber        string `json:"partNumber" gorm:"type:varchar(50)"`
	PartName          string `json:"partName" gorm:"type:varchar(100)"`
	Specification     string `json:"specification" gorm:"type:varchar(200)"`
	Category          string `json:"category" gorm:"type:varchar(50)"`
	WorkOrderQuantity int    `json:"workOrderQuantity"`
	Version           string `json:"version" gorm:"type:varchar(20)"`
	ProductionDate    string `json:"productionDate" gorm:"type:varchar(20)"`
	Process           string `json:"process" gorm:"type:varchar(50)"`
	StencilTop        bool   `json:"stencilTop"`
	StencilBot        bool   `json:"stencilBot"`
	ReflowFixture     bool   `json:"reflowFixture"`
	WaveFixture       bool   `json:"waveFixture"`
	PressFixture      bool   `json:"pressFixture"`
	BOM               bool   `json:"bom"`
	SOP               bool   `json:"sop"`
	ProductionMaterials bool `json:"productionMaterials"`
	Type              string `json:"type" gorm:"type:varchar(20)"`
}

// Stencil 钢网追踪
type Stencil struct {
	gorm.Model
	Serial        int    `json:"serial"`
	Model         string `json:"model" gorm:"type:varchar(100)"`
	Quantity      int    `json:"quantity"`
	OpenTime      string `json:"openTime" gorm:"type:varchar(20)"`
	AcceptanceTime string `json:"acceptanceTime" gorm:"type:varchar(20)"`
	Status        string `json:"status" gorm:"type:varchar(20)"`
	Notes         string `json:"notes" gorm:"type:text"`
}

// Fixture 治具追踪
type Fixture struct {
	gorm.Model
	Serial        int    `json:"serial"`
	Model         string `json:"model" gorm:"type:varchar(100)"`
	Quantity      int    `json:"quantity"`
	OpenTime      string `json:"openTime" gorm:"type:varchar(20)"`
	AcceptanceTime string `json:"acceptanceTime" gorm:"type:varchar(20)"`
	Status        string `json:"status" gorm:"type:varchar(20)"`
	Notes         string `json:"notes" gorm:"type:text"`
}

// SOPApproval SOP签核追踪
type SOPApproval struct {
	gorm.Model
	Serial      int    `json:"serial"`
	Model       string `json:"model" gorm:"type:varchar(100)"`
	Status      string `json:"status" gorm:"type:varchar(20)"`
	SubmitTime  string `json:"submitTime" gorm:"type:varchar(20)"`
	ApprovalTime string `json:"approvalTime" gorm:"type:varchar(20)"`
	Notes       string `json:"notes" gorm:"type:text"`
}
